# -*- coding:utf-8 -*-
from flask import Flask, render_template
from flask import request
from dpl import grade
# from dpl import selected_grade
import json
app = Flask(__name__)


@app.route('/')
def index():
    # 查询所有人成绩
    # print(selected_grade.select_gradeall(), '1')
    userlist = grade.grade_dateall()
    return render_template('test.html', userlist=userlist)


@app.route('/get_date_action')
def get_date_action():
    # 接收传来的值

    user_id = request.args.get('user_id')
    print(user_id)
    return grade.grade_date(user_id)


# @app.route('/select_grade_temp')
# def select_grade_temp():
#     print(selct_grade.selct_gradeall(), '1')
# return render_template('test.html',
# userlist=selct_grade.selct_gradeall())
# 查询个人成绩

if __name__ == '__main__':
    app.run(port=8000)
